package com.cy.member.parent;

import java.awt.Point;
import java.util.ArrayList;

import javax.swing.ImageIcon;

/**
 * 中国象棋棋子
 * @author CY
 */
public class ChineseChessman {
	//棋子背景图片
	private ImageIcon background = new ImageIcon("image/unknown.png");
	//棋子的引用
	private Chessman chessman = null;
	
	/**
	 * 设置棋子背景
	 * @param background
	 */
	protected void setBackground(String imagePath) {
		this.background = new ImageIcon(imagePath);
	}
	
	/**
	 * 获取背景
	 * @return
	 */
	public ImageIcon getBackground() {
		return background;
	}



	public void setBackground(ImageIcon background) {
		this.background = background;
	}



	/**
	 * 生成棋子
	 */
	public void generateChessman(boolean who) {
		chessman = new Chessman(background,this);
		chessman.setWho(who);
	}
	
	/**
	 * 获取车这个棋子
	 * @return
	 */
	public Chessman getChessman() {
		return chessman;
	}
	
	/**
	 * 设置棋子
	 * @param chessman
	 */
	public void setChessman(Chessman chessman) {
		chessman.setWho(this.chessman.isWho());
		this.chessman = chessman;
		chessman.setChineseChessman(this);
	}

	/**
	 * 移动
	 * @param site 目标坐标
	 */
	public boolean move(Point site, ArrayList<Point> points){
		return true;
	}
}
